package com.t.bricks.bussiness.service.loginlog.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.t.bricks.bussiness.db.dao.loginlog.LoginLogDao;
import com.t.bricks.bussiness.db.entity.loginlog.LoginLog;
import com.t.bricks.bussiness.service.loginlog.LoginLogService;
import com.t.bricks.model.MsgEmity;
import com.t.bricks.utils.function.ip.MacAddress;

/**
 * 登录日志'LoginLog表'基本业务操作类接口实现
 */
@Service
public class LoginLogServiceImpl implements LoginLogService<LoginLog> {

	@Autowired
	private LoginLogDao loginLogDao;
	
	/**
	 * Aop调用的新增登录日志
	 * @param sIp 登录者IP
	 * @param sNameOrNo 登录者使用的用户名或工号
	 * @return
	 */
	@Override
	public MsgEmity addByAop(String sIp, String sNameOrNo) {
		String sMACAddress = MacAddress.getMac(sIp);
		return loginLogDao.add(sIp, sMACAddress, sNameOrNo);
	}
	
}
